package com.txc.books.exception;

/**
 * 常用异常码定义。
 *
 * @author xkxu
 */
public class ExceptionCode {
    public static final ExceptionCode ILLEGAL_ARGUMENT = new ExceptionCode("dds-core-001", "非法参数。");
    public static final ExceptionCode DATA_ACCESS_ERROR = new ExceptionCode("dds-core-002", "数据访问异常。");
    public static final ExceptionCode OBJECT_EXISTS = new ExceptionCode("dds-core-003", "对象已存在。");
    public static final ExceptionCode SYSTEM_ERROR = new ExceptionCode("dds-core-004", "系统错误。");
    public static final ExceptionCode ILLEGAL_PRIMARY_KEY = new ExceptionCode("dds-core-005", "主键为空。");
    public static final ExceptionCode DATA_DESTORY = new ExceptionCode("dds-core-006", "数据完整性被破坏。");
    public static final ExceptionCode CONFIG_ERROR = new ExceptionCode("dds-core-007", "配置错误。");
    public static final ExceptionCode NON_SUPPORT = new ExceptionCode("dds-core-008", "不支持的操作。");
    private final String code;
    private final String message;

    public ExceptionCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

}
